﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Activation;
using System.Runtime.Remoting.Messaging;
using System.Runtime.Remoting.Proxies;
using System.Runtime.Remoting.Services;
using System.Text;

namespace LX.Core.Aop.Aspects
{
    public class ExceptionAspect : Aspect
    {
        public ExceptionAspect(Type serverType, MarshalByRefObject target)
            : base(serverType, target)
        {
        }

        public override void PreProcess()
        {
            Debug.Print("PreProcess");
        }

        public override void PostProcess()
        {

            Debug.Print("PostProcess");
        }

        public override ReturnMessage ProcessError(Exception error, IMethodCallMessage msg)
        {
            Debug.Print("ProcessError:" + error.ToString());
            return new ReturnMessage(new Exception("SB"), msg);
        }
    }
}
